package com.adapter.demo1;

import com.adapter.demo1.face.Duck;
import com.adapter.demo1.face.Turkey;

/**
 * 适配器
 * 
 * @author dell
 * 
 */
public class TurkeyAdapter implements Duck {

	Turkey turkey;

	// 组合进来
	public TurkeyAdapter(Turkey turkey) {
		this.turkey = turkey;
	}

	public void quack() {
		turkey.gobble();
	}

	public void fly() {
		for (int i = 0; i < 5; i++) {
			turkey.fly();
		}
	}

}
